<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
  <style>
    .el-header{
      line-height: 60px;
      background-color: pink;
      padding-left: 5%;
    }
    .el-main{
      text-align: center;
      background-color: aqua;height: 500px;
    }
    .el-footer{
      background-color:yellow;
    }
    .el-aside{
      background-color: navajowhite;
    }
  </style>
</head>
<body>
<div id="app">
  <el-container >
    <el-header>达内后台管理系统</el-header>
    <el-container>
      <el-aside width="200px">
        <el-menu background-color= gold>
          <el-submenu index="1">
            <template slot="title">
            <span>员工管理</span>
            </template>
            <el-menu-item index="1-1">员工列表</el-menu-item>
            <el-menu-item index="1-2">添加员工</el-menu-item>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">
              <span>部门管理</span>
            </template>
            <el-menu-item index="2-1">部门列表</el-menu-item>
            <el-menu-item index="2-2">添加部门</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-main>
        <p>员工列表</p>
        <el-table :data="arr" width="100%" cell-style="background-color: orange"
                  header-cell-style="background-color: #66ccff">
          <el-table-column type="index" label="序号"></el-table-column>
          <el-table-column prop="name" label="姓名"></el-table-column>
          <el-table-column prop="sal" label="工资" ></el-table-column>
          <el-table-column prop="job" label="工作" ></el-table-column>
          <el-table-column label="操作">
            <!--template 是自定义列时必须添加的标签，必须要有slot-scope-->
            <template slot-scope="scope">
              <el-button
                      size="mini"
                      type="danger"
                      @click="handleDelete(scope.$index, scope.row)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>

      </el-main>
    </el-container>
  </el-container>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
 let v = new Vue({
    el: '#app',
    data: function() {
      return {
        arr:[{name:"张三",sal:3000,job:"销售"},
          {name:"李四",sal:3000,job:"销售"},
          {name:"王五",sal:3000,job:"销售"}]
      }
    },
   methods:{
     handleDelete(i,e){
       v.arr.splice(i,1);
     }
   }
  })
</script>
</html>